import request from '/@/utils/imRequest';

/**
 * 初始化用户配置
 * @param query
 */
export function getUserInit(query?: Object) {
    return request({
        url: '/api/ims/user/init',
        method: 'get',
        params: query
    })
}

/**
 * 会话记录列表
 * @param query
 */
export function getHistoryMessages(query?: Object) {
    return request({
        url: '/api/ims/user/message/history',
        method: 'get',
        params: query
    })
}

/**
 * 用户列表
 * @param query
 */
export function getUsers(query?: Object) {
    return request({
        url: '/api/ims/user/list',
        method: 'get',
        params: query
    })
}


/**
 * 查询用户
 * @param query
 */
export function searchUsers(query?: Object) {
    return request({
        url: '/api/ims/user/search',
        method: 'get',
        params: query
    })
}

/**
 * 用户详情
 * @param query
 */
export function getUserDetail(query?: Object) {
    return request({
        url: '/api/ims/user/detail',
        method: 'get',
        params: query
    })
}

/**
 * 群组详情
 * @param query
 */
export function getGroupDetail(query?: Object) {
    return request({
        url: '/api/ims/user/group/detail',
        method: 'get',
        params: query
    })
}


/**
 * 获取用户好友列表
 * @param query
 */
export function getUserFriends(query?: Object) {
    return request({
        url: '/api/ims/user/friend/list',
        method: 'get',
        params: query
    })
}

/**
 * 获取用户好友申请列表
 * @param query
 */
export function getNewFriends(query?: Object) {
    return request({
        url: '/api/ims/user/friend/news',
        method: 'get',
        params: query
    })
}

/**
 * 发起好友申请
 * @param data
 */
export function applyNewFriendRequest(data?: Object) {
    return request({
        url: '/api/ims/user/friend/request',
        method: 'post',
        data: data
    })
}

/**
 * 响应好友申请
 * @param data
 */
export function responseNewFriendRequest(data?: Object) {
    return request({
        url: '/api/ims/user/friend/response',
        method: 'post',
        data: data
    })
}


/**
 * 响应好友申请
 * @param data
 */
export function getEmojis(data?: Object) {
    return request({
        url: '/api/ims/user/friend/response',
        method: 'post',
        data: data
    })
}
